package com.zx.mes.hyl.singleton;

import java.io.Serializable;

/**
 * singleton serializable double check
 *
 * @author huayunlong
 * @date 2018-9-12
 */
public class LazyDoubleCheckSerializableSingleton implements Serializable{

    private static LazyDoubleCheckSerializableSingleton instance;

    private LazyDoubleCheckSerializableSingleton(){}

    public static LazyDoubleCheckSerializableSingleton getInstance(){
        if (instance == null) {
            synchronized (LazyDoubleCheckSerializableSingleton.class) {
                if (instance == null) {
                    instance = new LazyDoubleCheckSerializableSingleton();
                }
            }
        }
        return instance;
    }
}
